<%@ page language="java" import="java.util.*" pageEncoding="utf-8" %>
<%@include file="/commons/taglibs.jsp" %>
<!DOCTYPE html>
<html>
<fmt:bundle basename="res">
<head>
    <meta charset="utf-8">
    <title><fmt:message key='ttblsjxt'/></title>
    <jsp:include page="/WEB-INF/commons/commons-header.jsp" flush="true"/>
    <style>
        html {
            background: #fff;
        }
    </style>
</head>

<body>
<div class="layui-container">
    <div class="layui-form" lay-filter="layuiadmin-app-form-list" id="layuiadmin-app-form-list" style="padding: 20px 30px 0 0;">

        <form:form commandName="seckillSession" method="${_method }" class="layui-form" id="form">
            <input type="hidden" name="_method" value="${_method }"/>
            <form:hidden path="id"/>

            <div class="layui-form-item">
                <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='mshdmc'/></label>
                <div class="layui-form-mid layui-word-aux">
                        ${seckillSession.name}
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='msrq'/></label>
                <div class="layui-form-mid layui-word-aux">
                        ${seckillSession.seckillTime}
                </div>
            </div>

            <div class="layui-form-item feijin-validityType-gudin-area">
                <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='mssj'/></label>

                <div class="layui-form-mid layui-word-aux">
                        ${seckillSession.seckillBeginTime}-${seckillSession.seckillEndTime}
                </div>
            </div>


            <div class="layui-form-item">
                <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='bmjzsj'/></label>
                <div class="layui-form-mid layui-word-aux">
                        ${seckillSession.applyDeadline}
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label"><b style="color:red">*</b> <fmt:message key='sysjlx'/></label>
                <div class="layui-form-mid layui-word-aux">
                    <c:choose>
                        <c:when test="${seckillSession.merchantScopeType eq 1}"><fmt:message key='qbsj'/></c:when>
                        <c:when test="${seckillSession.merchantScopeType eq 2}"><fmt:message key='zdsj'/></c:when>
                    </c:choose>
                </div>
            </div>


            <div class="layui-form-item" style="display:none;" id="feijin-scopeMerchant">
                <label for="" class="layui-form-label"><b style="color:red">*</b> <fmt:message key='zdsj'/></label>
                <div class="layui-input-block">
                    <table class="layui-table" lay-size="sm">
                        <thead>
                        <th><fmt:message key='sjzh'/></th>
                        <th><fmt:message key='dpmc'/></th>
                        </thead>
                        <tbody id="feijin-chooseMerchant-table">
                        <c:if test="${_method eq 'PUT'}">
                            <c:forEach items="${merchants}" var="merchant">
                                <tr id='tr${merchant.merchant.id}' data-id='${merchant.merchant.id}' class='feijin-scopeMerchant-ids'>
                                    <td>${merchant.merchant.username}</td>
                                    <td>${merchant.merchant.shopName}</td>
                                </tr>
                            </c:forEach>
                        </c:if>
                        </tbody>

                    </table>

                </div>
            </div>

        </form:form>
    </div>
</div>
<script>
    $(function () {

        if ("${seckillSession.merchantScopeType}" == 2) {
            $("#feijin-scopeMerchant").show();
        }

    });
</script>
</body>
</fmt:bundle>
</html>